﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.SqlServer.Server;

namespace Mondial2014.Models.Competition
{
    public class Fixture
    {
        public int Id { get; set; }

        [Display(Name = "משחק מספר")]
        public int Number { get; set; }

        public Stage Stage { get; set; }

        [Display(Name = "קבוצה 1")]
        public Team Team1 { get; set; }

        [Display(Name = "קבוצה 2")]
        public Team Team2 { get; set; }

        [Display(Name = "תאריך")]
        public DateTime Date { get; set; }

        [Range(0, 10)]
        public int Team1Score { get; set; }

        [Range(0, 10)]
        public int Team2Score { get; set; }

        public bool Played { get; set; }

        [NotMapped]
        [Display(Name = "תוצאה")]
        public string GetScore
        {
            get
            {
                return string.Format("{0} : {1}", Team1Score, Team2Score);
            }
        }
    }
}